import {del, get, post, put} from "@/api/requests";


export async function fetchQuartzs(params) {
    return get('schedu/adm/fetch', params);
}

export async function fetchQuartzInfoJson(params) {
    return get('schedu/adm/info', params);
}

/**
 * 页面操作编辑行为
 * @param params
 * @returns {Promise<*>}
 */
export async function addQuartzJson(data) {
    return post('schedu/adm/handleAdd', data);
}

/**
 * 页面操作编辑行为
 * @param params
 * @returns {Promise<*>}
 */
export async function updateQuartzJson(data) {
    return put('schedu/adm/handleUpdate', data);
}


/**
 * 页面操作刷新行为
 * @param params
 * @returns {Promise<*>}
 */
export async function Ref(params) {
    return put('schedu/adm/handleRef', params);
}

/**
 * 页面操作停止行为
 * @param params
 * @returns {Promise<*>}
 */
export async function Stop(row) {
    let params = {"jobName": row.jobName, "jobGroupName": row.jobGroupName}
    return put('schedu/adm/handlePause', params);
}

/**
 * 页面操作恢复行为
 * @param params
 * @returns {Promise<*>}
 */
export async function Renew(row) {
    let params = {"jobName": row.jobName, "jobGroupName": row.jobGroupName}
    return put('schedu/adm/handleResume', params);
}

export async function Delete(params) {
    return del('schedu/adm/handleDelete?id=' + params + '&times=' + new Date().getTime());
}